import Mock from 'mockjs'

/**
 * 1. 数据模拟
 * 2. ajax拦截
 *     ajax 异步JavaScript 和 xml(json)
 * */

/**
 *  1. 数据模拟
 * */
const  employees = Mock.mock({

    "list|5":[
        {
            "id|+1":1,
            "name":"@cname" // 占位符，@cname 随机中文姓名
        }
    ]
})

const resMsg = {
     success:true
}

/**
 *  2.ajax 拦截
 * */
Mock.mock("http://test.org/emp/list","get",employees.list);

Mock.mock("http://test.org/emp/login","get",resMsg);